let data_sum = []
// 第一次进入时，数据初始化，用于保护数据安全
load()
function load() {
  let data_sums = [
    "./formula_one.html",
    "./formula_two.html",
    "./formula_three.html",
    "./formula_four.html",
    "./formula_five.html",
    "./formula_six.html",
    "./formula_seven.html",
    "./formula_eight.html",
    "./formula_nine.html",
    "./formula_ten.html",
    "./formula_eleven.html",
    "./formula_twelve.html",
    "./formula_thirteen.html",
    "./formula_fourteen.html",
    "./formula_fiveteen.html",
  ];
  data_sum = data_sums

}
//  输入跳转
function clickon() {
  let fanyeSum = parseInt(document.getElementById("fanye_1").value)

  // fanyeSum = fanyeSum.replace(/[^0-9]/g,'').replace(/^([0-9]{0,4})?$/g,"$1")

  // 当输入框的数据类型不是数字，并且长度超过4
  if(typeof(fanyeSum) != "number" && fanyeSum.length > 4){

  }else{
    // 当data_sum 的长度 大于等于 输入框的数字 时，可以进行页面的跳转
    if(data_sum.length >= fanyeSum){

      let iframeElement = document.getElementById("myIframe");
      iframeElement.src = data_sum[fanyeSum-1];
      // console.log("fanyeSum=", fanyeSum);
    }
    
  }
}
//  页面跳转事件
function calculate(sum) {
  if (localStorage.getItem("work") == 1) {
    alert(TiShi);
    // return ''
  }

  // 获取 iframe 元素
  let iframeElement = document.getElementById("myIframe");
  // 设置 src 属性为新的地址
  iframeElement.src = data_sum[sum];
}